import React, { useEffect, FC } from 'react'
import { connect } from 'react-redux'

import { Form, Input, Button, message } from 'antd'
import { LockOutlined, UserOutlined } from '@ant-design/icons'

import './login.less'


// import Base64  from 'base-64';
import * as actions from '../../store/actions'
import {Link} from "react-router-dom";


const LoginForm: FC<any> = ({ history, setUserInfo}) => {

    // 触发登录方法
    const onFinish = ({userName, password,randomCode }:any): void => {

    }



    useEffect( () => {

    }, [])


    const FormView = (
        <Form className="login-form" name="login-form" onFinish={onFinish}>
            <Form.Item>
                <Link style={{float: "left"}} to="/register">注册</Link>
                <Link style={{float: "right"}} to="/forgot">忘记密码</Link>
            </Form.Item>
            <Form.Item>
                <div style={{textAlign:"center"}}>
                    <p>
                        客服电话: 400-001-8080
                    </p>
                </div>
            </Form.Item>
        </Form>
    )
    return (
        <div className="login-layout" id="login-layout">
            <div className="login-box">
                <div className="logo-name">医视界 | 远程继续医学教育平台</div>
                <div className={"login-form-box"}>
                    {FormView}
                </div>
            </div>
        </div>
    )
}

export default connect(
    (state) => state,
    actions
)(LoginForm)
